package com.yuba.front.domain.bo;

import com.yuba.common.core.validate.AddGroup;
import com.yuba.common.core.validate.EditGroup;
import com.yuba.common.mybatis.core.domain.BaseEntity;
import com.yuba.front.domain.Posts;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 帖子业务对象 posts
 *
 * @author modakai
 * @date 2024-12-02
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = Posts.class, reverseConvertGenerate = false)
public class PostsBo extends BaseEntity {

    /**
     * 对象存储主键
     */
    @NotNull(message = "对象存储主键不能为空", groups = { EditGroup.class })
    private Long postId;

    /**
     * 用户ID
     */
    @NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long userId;

    /**
     * 分类ID
     */
    @NotNull(message = "分类ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long categoryId;

    /**
     * 帖子标题
     */
    @NotBlank(message = "帖子标题不能为空", groups = { AddGroup.class, EditGroup.class })
    private String title;

    /**
     * 帖子内容
     */
    @NotBlank(message = "帖子内容不能为空", groups = { AddGroup.class, EditGroup.class })
    private String content;

    /**
     * 点赞
     */
    @NotNull(message = "点赞不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long likeCount;

    /**
     * 浏览量
     */
    @NotNull(message = "浏览量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long viewCount;

    /**
     * 收藏量
     */
    @NotNull(message = "收藏量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long collectCount;

    /**
     * 评论量
     */
    @NotNull(message = "评论量不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long commentCount;

    /**
     * 封面图片OSSid
     */
//    @NotNull(message = "封面图片OSSid不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long cover;

    private String imageUrl;
    /**
     * 是否精选
     */
    @NotBlank(message = "是否精选不能为空", groups = { AddGroup.class, EditGroup.class })
    private String choiceFlag;

    /**
     * 是否置顶
     */
    @NotBlank(message = "是否置顶不能为空", groups = { AddGroup.class, EditGroup.class })
    private String pinnedFlag;

    /**
     * 是否发布
     */
    @NotBlank(message = "是否发布不能为空", groups = { AddGroup.class, EditGroup.class })
    private String releaseFlag;

    /**
     * 是否隐藏
     */
    @NotBlank(message = "是否显示 不能为空", groups = { AddGroup.class, EditGroup.class })
    private String showFlag;

    /**
     * 状态
     */
    @NotBlank(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;

    /**
     * 编辑时间
     */
    @NotNull(message = "编辑时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date editTime;

    /**
     * 备注
     */
    @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class })
    private String remark;

    /**
     * 推荐分数
     */
    private Integer recommendScore;

    /**
     * 推荐时间戳
     */
    private Long recommendTime;

}
